//分页参数
var absPage=0;

	  initReview(0,10);	
	 function docDetail(id){
		 window.location.href="/article/page/"+id;
	}
	
	function initReview(absPage,pageSize){
		var url =  '/article/getList/'+ absPage +"/" +pageSize;
		$.get(url,function(data,status){
			if(status == "success"){ 
			    if(data.status){ 
			    	var htmlStr="";
			    	if(data.resultObj != null ){
						$.each(data.resultObj, function(i, item) {
				    		htmlStr +="<dl class='clearfix'  onclick='docDetail("+item.id+")'>";
				    		htmlStr +="<dt><img src='"+item.pic+"?Math.random()' /></dt>";
				    		htmlStr +="<dd>";
				    		htmlStr +="<h3 class='ellipsis_1'>"+item.title+"</h3>";
				    		htmlStr +="<p class='ellipsis_1'>"+item.abst+"</p>";
				    		htmlStr +="<p><span>发布于："+item.createTime+"</span></p>";
				    		htmlStr +="</dd>";
				    		htmlStr +="</dl>";
						});
						$(htmlStr).appendTo("#cont_list");
			    }
			}else{
		    alert(data.msg);
			}
			}
		},"json"); 
		}

	//var canLoad = true;
	$(window).scroll(function () {
	    var totalHeight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
	    var docHeight = $(document).height() - 100;
	    if (docHeight <= totalHeight + 1 ) {
	        //canLoad = false;
	        ++absPage;
			initReview(absPage*10,10);
	       console.info("222222222");
	        
	    }
	});
	
	




